package org.yray.sip.rtp.server;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.epoll.EpollDatagramChannel;

public class EpollUrtpChannelInitializer extends ChannelInitializer<EpollDatagramChannel> {
    private UrtpServerHandler urtpServerHandler;

    public EpollUrtpChannelInitializer(UrtpServerHandler urtpServerHandler) {
        this.urtpServerHandler = urtpServerHandler;
    }

    @Override
    protected void initChannel(EpollDatagramChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(urtpServerHandler);
    }
}
